builder.component{
    current.clients.add(protocol.HTTP)
    current.clients.add(protocol.FILE)
    current.clients.add(protocol.CLAP)
    application(uri:gwtRoot){
        router{
        	filter = filter(uri:"/static", ofBean:"gwtDirFilter")        	
            dir = directory(uri:"/static",root:"clap://class/static", 
            		autoAttach:false)
            filter.next = dir
            resource(uri:"/", ofBean:"gwtHome")
        }
    }    
    
    application(uri:apiRoot){
    	def filter = filter(uri:"",ofBean:"variantFilter")
    	
    	filter.next = router(autoAttach:false){
    		resource(uri:"/sources.{type}", ofBean:"sourcesResource")
    		//for GET
    		resource(uri:"/source/{name}.{type}", ofBean:"sourceResource")
    		//for PUT and DELETE
    		resource(uri:"/source/{name}", ofBean:"sourceResource")
    		//for POST
    		resource(uri:"/source", ofBean:"sourceResource")
    	}
    }
}